package com.cloud.salon.client.menber.repository;

import java.util.List;

import com.cloud.salon.common.base.entity.menber.Staff;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/*
 * @Description 员工仓库接口
 * @Author wolf--LZH
 * @CreateDate 2019/4/26 0026 下午 10:01
 */
public interface StaffRepository extends JpaRepository<Staff, Integer> {

	Staff findByUserId(Integer userId);

	@Query(value = "from Staff where number = ?1")
	Staff findByNumber(String number);
	
	@Query(value = "from Staff where id_card = ?1")
	Staff findByIDNumber(String idCard);
	
	@Query(value = "from Staff where number like %?1% or name like %?1%")
	List<Staff> findByKey(String key);
}